Optimal. Leaf size=226 \[ \frac {C \sec ^{1+m}(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}-\frac {(C (m+n)+A (1+m+n)) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1-m-n);\frac {1}{2} (3-m-n);\cos ^2(c+d x)\right ) \sec ^{-1+m}(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (1-m-n) (1+m+n) \sqrt {\sin ^2(c+d x)}}+\frac {B \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-m-n);\frac {1}{2} (2-m-n);\cos ^2(c+d x)\right ) \sec ^m(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (m+n) \sqrt {\sin ^2(c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 226, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {20, 4132, 3857,
2722, 4131} \begin {gather*} -\frac {(A (m+n+1)+C (m+n)) \sin (c+d x) \sec ^{m-1}(c+d x) (b \sec (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-m-n+1);\frac {1}{2} (-m-n+3);\cos ^2(c+d x)\right )}{d (-m-n+1) (m+n+1) \sqrt {\sin ^2(c+d x)}}+\frac {B \sin (c+d x) \sec ^m(c+d x) (b \sec (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-m-n);\frac {1}{2} (-m-n+2);\cos ^2(c+d x)\right )}{d (m+n) \sqrt {\sin ^2(c+d x)}}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (b \sec (c+d x))^n}{d (m+n+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 20
Rule 2722
Rule 3857
Rule 4131
Rule 4132
Rubi steps
\begin {align*} \int \sec ^m(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\left (\sec ^{-n}(c+d x) (b \sec (c+d x))^n\right ) \int \sec ^{m+n}(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\\ &=\left (\sec ^{-n}(c+d x) (b \sec (c+d x))^n\right ) \int \sec ^{m+n}(c+d x) \left (A+C \sec ^2(c+d x)\right ) \, dx+\left (B \sec ^{-n}(c+d x) (b \sec (c+d x))^n\right ) \int \sec ^{1+m+n}(c+d x) \, dx\\ &=\frac {C \sec ^{1+m}(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\left (B \cos ^{m+n}(c+d x) \sec ^m(c+d x) (b \sec (c+d x))^n\right ) \int \cos ^{-1-m-n}(c+d x) \, dx+\left (\left (A+\frac {C (m+n)}{1+m+n}\right ) \sec ^{-n}(c+d x) (b \sec (c+d x))^n\right ) \int \sec ^{m+n}(c+d x) \, dx\\ &=\frac {C \sec ^{1+m}(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac {B \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-m-n);\frac {1}{2} (2-m-n);\cos ^2(c+d x)\right ) \sec ^m(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (m+n) \sqrt {\sin ^2(c+d x)}}+\left (\left (A+\frac {C (m+n)}{1+m+n}\right ) \cos ^{m+n}(c+d x) \sec ^m(c+d x) (b \sec (c+d x))^n\right ) \int \cos ^{-m-n}(c+d x) \, dx\\ &=\frac {C \sec ^{1+m}(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}-\frac {\left (A+\frac {C (m+n)}{1+m+n}\right ) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (1-m-n);\frac {1}{2} (3-m-n);\cos ^2(c+d x)\right ) \sec ^{-1+m}(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (1-m-n) \sqrt {\sin ^2(c+d x)}}+\frac {B \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-m-n);\frac {1}{2} (2-m-n);\cos ^2(c+d x)\right ) \sec ^m(c+d x) (b \sec (c+d x))^n \sin (c+d x)}{d (m+n) \sqrt {\sin ^2(c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.14, size = 292, normalized size = 1.29 \begin {gather*} -\frac {i 2^{1+m+n} \left (\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^{m+n} \left (\frac {4 C e^{2 i (c+d x)} \, _2F_1\left (1,\frac {1}{2} (-m-n);\frac {1}{2} (4+m+n);-e^{2 i (c+d x)}\right )}{\left (1+e^{2 i (c+d x)}\right ) (2+m+n)}+\frac {2 B e^{i (c+d x)} \, _2F_1\left (1,\frac {1}{2} (1-m-n);\frac {1}{2} (3+m+n);-e^{2 i (c+d x)}\right )}{1+m+n}+\frac {A \left (1+e^{2 i (c+d x)}\right ) \, _2F_1\left (1,\frac {1}{2} (2-m-n);\frac {1}{2} (2+m+n);-e^{2 i (c+d x)}\right )}{m+n}\right ) \sec ^{-2-n}(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{d (A+2 C+2 B \cos (c+d x)+A \cos (2 (c+d x)))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.41, size = 0, normalized size = 0.00 \[\int \left (\sec ^{m}\left (d x +c \right )\right ) \left (b \sec \left (d x +c \right )\right )^{n} \left (A +B \sec \left (d x +c \right )+C \left (\sec ^{2}\left (d x +c \right )\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (b \sec {\left (c + d x \right )}\right )^{n} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{m}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (\frac {b}{\cos \left (c+d\,x\right )}\right )}^n\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^m\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________